<?php
 /**
* @Author:  	Daniel Dinh
* @Email:   	webdevelopmentvn@gmail.com
* @Link: 		http://joomsoft.net
* @Version: 	1.0
* @copyright:	Joomsoft.net
* @license:		GNU Lesser GPL
*/
// No direct access.
defined('_JEXEC') or die;
?>
<div class="fe_form">
	<div class="weekly_title">
		<?php echo JText::_("COM_FARMACITY_PERIOD_LISTING_TITLE");?>
	</div>
	<div class="weekly_introtext">
		<?php echo JText::_("COM_FARMACITY_PERIOD_LISTING_DESCRIPTION");?>
	</div>


<div class="link_bar">
<a href="<?php echo JRoute::_("index.php?option=com_farmacity&task=period.add");?>"><?php echo JText::_("COM_FARMACITY_PERIOD_NEW");?></a> | <a href="<?php echo JRoute::_("index.php?option=com_farmacity&task=weektime.add");?>"><?php echo JText::_("COM_FARMACITY_PERIOD_WEEKLY_TIME");?></a>
</div>
<table class="tablelist">
<tr class="row_1">
	<td width="10"><?php echo JTEXT::_("COM_FARMACITY_PERIOD_FIELD_HEADER_NO");?></td>
	<td ><?php echo JTEXT::_("COM_FARMACITY_PERIOD_FIELD_HEADER_NAME");?></td>
	<td width="50"><?php echo JTEXT::_("COM_FARMACITY_PERIOD_FIELD_HEADER_FROM");?></td>
	<td width="50"><?php echo JTEXT::_("COM_FARMACITY_PERIOD_FIELD_HEADER_TO");?></td>
	<td width="70"><?php echo JTEXT::_("COM_FARMACITY_PERIOD_FIELD_HEADER_ACTION");?></td>
</tr>
<?php if($this->items):
	$i = 1;
	foreach($this->items as $item):?>
	<tr class="<?php echo $i%2==0 ? "bg_chan" : "bg_le";?>">
		<td><?php echo $i;?></td>	
		<td><?php echo $item->title;?></td>	
		<td><?php echo date('d-m',strtotime($item->dal));?></td>	
		<td><?php echo date('d-m',strtotime($item->al));?></td>	
		<td>
		<a href="<?php echo JRoute::_("index.php?option=com_farmacity&task=period.edit&id=".$item->id);?>"><img src="<?php echo JURI::root();?>components/com_farmacity/assets/images/edit.png" /></a>
		<a href="<?php echo JRoute::_("index.php?option=com_farmacity&task=periods.remove&id=".$item->id);?>"><img src="<?php echo JURI::root();?>components/com_farmacity/assets/images/delete.gif" /></a>
		<a href="<?php echo JRoute::_("index.php?option=com_farmacity&task=weektime.edit&pid=".$item->id);?>"><img src="<?php echo JURI::root();?>components/com_farmacity/assets/images/weekly.png" /></a>
		</td>	
	</tr>
<?php 
$i++;
endforeach;
endif;
?>	
</table>

<div class="link_bar">
<a href="<?php echo JRoute::_("index.php?option=com_farmacity&task=period.add");?>"><?php echo JText::_("COM_FARMACITY_PERIOD_NEW");?></a> | <a href="<?php echo JRoute::_("index.php?option=com_farmacity&task=weektime.add");?>"><?php echo JText::_("COM_FARMACITY_PERIOD_WEEKLY_TIME");?></a>
</div>

</div>
